<%@page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@page	import="java.util.ArrayList,com.alibaba.dubbo.demo.bean.SysDeptInfo"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%@page import="java.lang.Integer"%>
<%@page import="java.lang.String"%>
<%@page	import="com.point.community.bean.dwzPageData"%>
<script src="/js/treeTable/jquery.treeTable.js" type="text/javascript"> </script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
	 dwzPageData dwzData;
     if(request.getSession().getAttribute("deptInfoDwzData")!=null)
     	dwzData =(dwzPageData)request.getSession().getAttribute("deptInfoDwzData"); 
     else
     	dwzData = new dwzPageData();
%>
<div class="pageHeader">
    <form id="pagerForm" rel="pagerForm" onsubmit="return navTabSearch(this);" action="webQueryAllDeptInfo" method="post">
        <input type="hidden" name="pageNum" value="<%=dwzData.currentPage%>" />
        <input type="hidden" name="numPerPage" value="<%=dwzData.numPerPage%>" /> 
        <input type="hidden" name="method" value="page" />
        <input type="hidden" name="all" value="1" />
        <div class="searchBar">
            <table class="searchContent">
				<tr>
					<td>部门编号：
						<input type="text" name="deptcode" value="<s:property value="#session.deptcode" />" />
					</td>
					<td>部门名称：<input type="text" name="deptname"
						value="<s:property value="#session.deptname" />" />
					</td>
					<td>
							<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">检索</button>
							</div>
						</div>
					</td>		
				</tr>
			</table>
			
        </div>
    </form>
</div>
<div class="pageContent">
    <div class="panelBar">
        <ul class="toolBar">
            <li><a class="add" href="deptinfoupdate.jsp?action=add" target="navTab" ><span>添加新部门</span></a></li>
            <li class="line">line</li>
        </ul>
    </div>
    <table class="table" layoutH="108">
		<thead>
			<tr>
			<!-- <th width="40">序号</th>  -->	
				<th width="60">部门编号</th>
				<th width="120">部门名称</th>
				<th width="80">上级部门</th>
				<th width="80">负责人</th>
				<th width="120">电话</th>
				<th width="160">备注</th>
				<th width="160">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;操作</th>
			</tr>
		</thead>
		<tbody>
			<% 
				int nIndex = 1;
			%>
			<s:iterator value="#session.sysDeptinfoList" status="m">
				<tr target="sid_user" rel="<s:property value="deptid" />">
				<!-- 	<td><%=nIndex %></td> 
					<% 
						nIndex ++;
					%> -->
					<td><s:property value="deptid" /></td> 
					<td> 
						<s:if test="0 != upperid">&nbsp;|</s:if>
						<s:bean name="org.apache.struts2.util.Counter" id="counter">
						    <s:param name="first" value="1" />
						    <s:param name="last" value="deptlevel" />
						    <s:iterator>
						        __
						    </s:iterator>
						</s:bean>
						<s:property value="deptname" /></td>
					<td><s:property value="upperid" /></td> 
					<td><s:property value="manager" /></td>
					<td><s:property value="phone" /></td>
					<td><s:property value="remark" /></td>
					<td>
					<a class="edit" href="./webQueryOneDept?deptid=<s:property value="deptid"/>" target="navTab">修改</a>
						&nbsp;&nbsp;&nbsp;
					<s:if test="1 == isvalid">
						<s:if test="0 == childnum">
							<a  class="delete" href="./updateDeptInfoFlag?deptid=<s:property value="deptid"/>&action=edit&valid=0"  title="确定要作废吗?" target="ajaxTodo" refresh="true">作废</a></td>	
						</s:if>
					</s:if>
					<s:if test="0 == isvalid">
						<a  class="delete" href="./updateDeptInfoFlag?deptid=<s:property value="deptid"/>&action=edit&valid=1"  title="确定要恢复吗?" target="ajaxTodo" refresh="true">恢复</a></td>
					</s:if>
				</tr>
			</s:iterator>
		</tbody>
	</table>
     <div class="panelBar">
        <div class="pages">
            <span>显示</span>
            <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
                <option value="10" <s:if test="10 == #session.numPerPage">selected="selected"</s:if>>10</option>
                <option value="20" <s:if test="20 == #session.numPerPage">selected="selected"</s:if>>20</option>
                <option  value="50"  <s:if test="50 == #session.numPerPage">selected="selected"</s:if>>50</option>
                <option  value="100"  <s:if test="100 == #session.numPerPage">selected="selected"</s:if>>100</option>
            </select>
            <span>条，共<%=dwzData.totalCount%>条</span>
        </div>
        <div class="pagination" targetType="navTab" totalCount= "<%=dwzData.totalCount%>" numPerPage="<%=dwzData.numPerPage%>" pageNumShown="<%=dwzData.pageNumShown%>" currentPage="<%=dwzData.currentPage%>" ></div>
    </div>

	<script type="text/javascript">
		$("body").ready(function() {
			if(canWriteData('func00201')!=1)
			{
				$('.add').hide();
				$('.edit').hide();
				$('.delete').hide();
			}
		});   
	</script> 
</div>